From: Keir Fraser Date: Sat, 31 Mar 2007 11:20:31 +0000 (+0100) Subject: xen: Fix numa=on boot. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15270^2~27 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=ee4af65156102290fac71db0a9c300459cff0a1c;p=xen.git xen: Fix numa=on boot. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 446c42f3d9..1e58905523 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -591,8 +591,6 @@ void __init __start_xen(multiboot_info_t *mbi) numa_initmem_init(0, max_page); - end_boot_allocator(); - /* Initialise the Xen heap, skipping RAM holes. */ nr_pages = 0; for ( i = 0; i < e820.nr_map; i++ ) @@ -618,6 +616,8 @@ void __init __start_xen(multiboot_info_t *mbi) nr_pages >> (20 - PAGE_SHIFT), nr_pages << (PAGE_SHIFT - 10)); + end_boot_allocator(); + early_boot = 0; early_cpu_init(); diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index b6e0afb174..bda9931e92 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -512,6 +512,14 @@ void init_heap_pages( ASSERT(zone < NR_ZONES); + if ( unlikely(avail[0] == NULL) ) + { + /* Start-of-day memory node 0 initialisation. */ + init_heap_block(&_heap0); + _heap[0] = &_heap0; + avail[0] = avail0; + } + if ( likely(page_to_mfn(pg) != 0) ) nid_prev = phys_to_nid(page_to_maddr(pg-1)); else @@ -570,10 +578,6 @@ void end_boot_allocator(void) unsigned long i; int curr_free, next_free; - init_heap_block(&_heap0); - _heap[0] = &_heap0; - avail[0] = avail0; - /* Pages that are free now go to the domain sub-allocator. */ if ( (curr_free = next_free = !allocated_in_map(first_valid_mfn)) ) map_alloc(first_valid_mfn, 1);